{_include admin_menu}
<form method="post" action="<?php echo base_url('admin/category/orderupdate'); ?>" class="form-horizontal">
	<div class="left_content">
		<legend>จัดหมวดหมู่ <a style="float:right;" href="<?php echo base_url('admin/category/add'); ?>" class="btn btn-primary"> Add </a></legend>
		<table class="table table-hover" >
	 		<thead>
				<tr>
					<th>รหัส</th>
					<th>ชื่อ</th>
					<th>เรียง</th>
					<th>ตัวเลือก</th>
				</tr>
			</thead>
			<tbody>
				<?php
					echo Util::buildCategoriesTableList(0,$categories);
				?>
			</tbody>
		</table>
	</div>
	<div class="left_content">
		<input type="submit" name="submit" value="submit" class="btn btn-primary" >
	</div>
</form>

<script type="text/javascript">
  $('a.keep').click(function () {
  	var cls = $(this).attr("children");
   	$("tr."+cls).toggle(200);
    return false;
  });

  $('tbody tr').each(function () {
  	if(!$(this).hasClass('children0')){
  		$(this).toggle(200);
  	}
  });
</script>